// Copyright (c) 2020 Wang Zemin Personal. All Right Reserved

import {Route, Switch, Redirect, withRouter} from 'react-router-dom';
import React from "react";
import "./content-main.css"
import {
    BudgetAuditingLogIndex, BudgetManageIndex,
    KeyAuditingLogIndex,
    KeyManageIndex,
    OwnKeyAuditingLogIndex,
    OwnKeyManageIndex,
    RoleManageIndex, UserManageIndex, WeeklyDashboardIndex
} from "../component/IndexPages";
import WeeklyBudgetUsageDonutChart from "../component/chart/WeeklyBudgetUsageDonutChart";

class ContentMain extends React.Component {
    render() {
        return (
            <div className='content-main'>
                <Switch>
                    <Redirect exact from="/index" to='/index/key/own'/>
                    <Route exact path='/index/key/own' component={OwnKeyManageIndex}/>
                    <Route exact path='/index/key/all' component={KeyManageIndex}/>
                    <Route exact path='/index/key/auditing/all' component={KeyAuditingLogIndex}/>
                    <Route exact path='/index/key/auditing/own' component={OwnKeyAuditingLogIndex}/>
                    <Route exact path='/index/system/role' component={RoleManageIndex}/>
                    <Route exact path='/index/system/user' component={UserManageIndex}/>
                    <Route exact path='/index/system/budget' component={BudgetManageIndex}/>
                    <Route exact path='/index/system/budget/auditing' component={BudgetAuditingLogIndex}/>
                    <Route exact path='/index/weekly/dashboard' component={WeeklyDashboardIndex}/>
                </Switch>
            </div>
        )
    }
}

export default withRouter(ContentMain);

